import request from "@/utils/request.js";

/**
 * 分类数据tree数据
 * @param pram
 */
export function treeCategroy(pram) {
	const data = {
		type: pram.type,
		status: pram.status
	}
	return request.get('api/admin/mer/category/list/tree', data)
}
/**
 * 更新分类
 * @param pram
 */
export function adviceCategory(pram) {
  const data = {
    extra: pram.extra,
    name: pram.name,
    pid: pram.pid,
    sort: pram.sort,
    status: pram.status,
    type: pram.type,
    url: pram.url,
    id: pram.id,
    isAdvice: pram.isAdvice
  }
  return request.put('api/admin/mer/category/advice', data)
}
/**
 * 更新分类
 * @param pram
 */
export function updCategory(pram) {
  const data = {
    extra: pram.extra,
    name: pram.name,
    pid: pram.pid,
    sort: pram.sort,
    status: pram.status,
    type: pram.type,
    url: pram.url,
    id: pram.id,
    isAdvice: pram.isAdvice
  }
  return request.post('api/admin/mer/category/updCategory', data)
}

/**
 * 修改分类加价率
 * @param data
 */
export function categroyRatioUpdate(data) {
	return request.post('api/admin/mer/category/ratio/update', data)
}